home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16006 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: newsfeed.concentric.net!news
  2. From: "Alan L. Lovejoy" <alovejoy@concentric.net>
  3. Newsgroups: comp.lang.java,comp.lang.c++,comp.lang.smalltalk
  4. Subject: Re: Will Java kill C++?
  5. Date: Mon, 08 Apr 1996 18:13:17 -0700
  6. Organization: Modulation
  7. Message-ID: <3169B9AD.2701@concentric.net>
  8. References: <3134D499.653E@ix.netcom.com> <313613B2.136E@ksopk.sprint.com> <4i7qhl$ik6@cronkite.seas.gwu.edu> <4iuhi7$fmf@sundog.tiac.net> <4iumap$mn5@hustle.rahul.net> <31582A45.3742@vmark.com> <3163C031.4FB1@esec.ch> <3164888D.2B01@concentric.net> <4kbfn8$1bu@news1.is.net>
  9. NNTP-Posting-Host: cnc009050.concentric.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. Mark VanTassel wrote:
  16. > "Alan L. Lovejoy" <alovejoy@concentric.net> wrote:
  17. > >Bzzzt!  Not according to the benchmarks I've done.  Go benchmark the factorial or fibonacci
  18. > >functions (implemented recursively) in both C and a good Smalltalk.  You are in for a big
  19. > >surprise.
  20. > You're not seriously suggesting that a fibonacci series be programmed
  21. > recursively, are you??? Have you looked at the number of operations
  22. > involved in calculating, say, the 1000th term as vs a standard looping
  23. > approach?
  24. > I don't think this is a valid benchmark... (and I too fail to see how
  25. > Smalltalk can be faster than C++ except perhaps in bizarre special
  26. > cases)
  27. > - /\/\ark \/anTassel (mvantassel@teambca.com)
  28.  
  29. Sigh.  The point is the relative speed of function call versus
  30. message send.  Whether a recursive algorithm is better or worse
  31. than the equivalent iterative algorithm simply has nothing to do
  32. with it, because the issue was not "which language can compute
  33. factorials faster," but rather "is a function call faster than
  34. a message send."
  35.  
  36. The most important case where Smalltalk can be faster than C is when
  37. the initial version of the Smalltalk program is done ten times faster
  38. than the initial C version, and the Smalltalk programmer(s) spend
  39. the remaining time optimizing the code (by using more sophisticated
  40. algorithms, perhaps).
  41.  
  42. --Alan
  43.